package com.benworks.test.mockito.helloworld;


public class HelloWorld {
	
	private MyRobot mRobot;

	public MyRobot getRobot() {
		return mRobot;
	}

	public void setRobot(MyRobot robot) {
		this.mRobot = robot;
	}

	/**
	 * This is the method we want to test. When there is an robot, this method
	 * return the robot's information otherwise, return some sorry text
	 */
	public String sayHello() {
		MyRobot robot = getRobot();
		if (null != robot) {
			return robot.getSomeInfo();
		}

		return "No robot here, sorry!";
	}

	/**
	 * MyRobot class
	 */
	public static class MyRobot {

		/**
		 * Get some information from somewhere, the implementation may varies
		 */
		public String getSomeInfo() {
			return "Hello World -- From robot";
		}
	}
}